package com.ymatou.iapi.leaf.service;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.google.common.reflect.TypeToken;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymttest.business.YmatouAutoTestCall;
import com.ymttest.utils.EnvSetup;

public class GetSeqIdsCall extends YmatouAutoTestCall {

	private static String opurl = "trading/getSeqIds";

	public GetSeqIdsCall() {
		super(EnvSetup.getSystemUrl("leaf_iapi_shop2cn"), opurl, "POST", "JSON");
	}

	@Override
	public void addDefHeader() {
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}

	/**
	 * 获取id
	 * 
	 * @return
	 */
	public List<Long> getids() {

		List<Long> ids = new ArrayList<>();
		try {
			ids=(List<Long>) FormatUtil.GSONToObject(getString("ids"),new TypeToken<List<Long>>() {}.getType());
		} catch (Exception e) {

			Logger.info(String.format("接口返回状态码: %s", this.getStatusCode()));

			e.printStackTrace();
		}
		return ids;
	}
}
